package com.houserent.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.houserent.entry.HouseResult;
import com.houserent.service.OrderService;

@Controller
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService order;

    @ResponseBody
    @RequestMapping("/addCust.do")
    public HouseResult addCust(String houseId, String userName, String userCertNum, String userLinkPhone,
            String userSex, String userEmail, String userqq, String useStartDate, String useType, String payGuarantyFee) {
        return order.addCust(houseId, userName, userCertNum, userLinkPhone, userSex, userEmail, userqq, useStartDate,
                useType, payGuarantyFee);
    }

    @ResponseBody
    @RequestMapping("/endOrder.do")
    public HouseResult endOrder(String houseId) {
        return order.endOrder(houseId);
    }

    @ResponseBody
    @RequestMapping("/optOrder.do")
    public HouseResult optOrder(String orderId, String optType) {
        return order.optOrder(orderId, optType);
    }
}
